package json;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.junit.Test;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;

public class DateTest {

	@Test
	public void first(){
		
		System.out.println(JSON.toJSONString(new Date()));
	}
	
	@Test
	public void second(){
		
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("date", new Date());
		System.out.println(JSON.toJSONString(map, SerializerFeature.WriteDateUseDateFormat));
		
		Map<String, Date> map2 = new HashMap<String, Date>();
		map2.put("date", new Date());
		System.out.println(JSON.toJSONString(map2));
	}
}
